package com.dhcc.core.api.shiro;

import org.apache.shiro.subject.Subject;
import org.apache.shiro.subject.SubjectContext;
import org.apache.shiro.web.mgt.DefaultWebSubjectFactory;

/**
 * 重写的目的是不创建session
 * 
 * @ClassName: ApiSubjectFactory
 * @Description: TODO
 * @author: cyf
 * @date: 2018年1月2日 上午10:08:20
 */
public class ApiSubjectFactory extends DefaultWebSubjectFactory {
    @Override
    public Subject createSubject(SubjectContext context) {
        // 不创建session
        context.setSessionCreationEnabled(false);
        return super.createSubject(context);
    }
}